import {
  animate,
  style,
  transition,
  trigger,
  AnimationTriggerMetadata
} from '@angular/animations';
import { AnimationDuration } from './animation';

export const fadeMotion: AnimationTriggerMetadata = trigger('fadeMotion', [
  transition(':enter', [
    style({ opacity: 0 }),
    animate(`${AnimationDuration.BASE}`, style({ opacity: 1 }))
  ]),
  transition(':leave', [
    style({ opacity: 1 }),
    animate(`${AnimationDuration.BASE}`, style({ opacity: 0 }))
  ])
]);
